<%@ page import="controllers.SolutionConnect" %>
<%
	String sSolID = request.getParameter("sol_id");
	if ( sSolID == null ){
		response.sendRedirect("/home.jsp?error=No solution id is null.");
	}
	Long lSolID = Long.parseLong(sSolID);
	if ( !SolutionConnect.doesRecordExists("solID", lSolID) ) {
		response.sendRedirect("/home.jsp?error=No such solution exists.");
	}
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/js/editor/tiny_mce.js"></script>
<script type="text/javascript">var _show_editor=false;</script><style type="text/css" media="all">@import "/css/global.css";</style>
<title>Adoption</title><link rel="stylesheet" type="text/css" href="/css/coreBlue.css">
<link rel="stylesheet" type="text/css" href="/css/defaultThemeNew.css?OpenPage">
<link rel="stylesheet" type="text/css" href="/css/iehacks1.css">
<link rel="stylesheet" type="text/css" href="/css/blog.css">
<link rel="stylesheet" type="text/css" href="/css/celestica_microsite.css">
<link rel="stylesheet" type="text/css" href="/css/nyroModal.css">
<script language="JavaScript" type="text/javascript" src="/js/calendar.js?OpenJavascriptLibrary"> 
</script>
 
<script language="JavaScript" type="text/javascript"> 
<!-- 
 
//AJaX Name Picker
function getSingleName(returnField, specialParameters) {
 
frm = window.document.forms[0];
var url = "/" + frm.imgPath.value;
	setTimeout("window.open('"+url+"/NABPickerSingle?open&returnfield=" + returnField + specialParameters + "', 'popupWindow', 'toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,resize=yes,menubar=no,height=410,width=320')", 1);
}

function getSingleName_p(returnField, specialParameters) {

	frm = window.document.forms[0];
	var url = "/" ;
	setTimeout("window.open('/utils/contact-remote.jsp?open&returnfield=" + returnField + specialParameters + "', 'popupWindow', 'toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,resize=yes,menubar=no,height=410,width=900')", 1);
	/*setTimeout(
			"window.open('"
					+ url
					+ "utils/contact-remote.jsp?returnfield=" + returnField + specialParameters + "&pageNum=1&search="
					+ "', 'popupWindow', 'toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,resize=yes,menubar=no,height=410,width=320')",
			1);
	*/
}


function GetMultiNames(returnField, specialParameters) {
frm = window.document.forms[0];
var url = "/" + frm.imgPath.value;
	var turl =  url + "/NABPickerMulti?open&returnfield=" + returnField + specialParameters;
	var wchrome = "toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,resize=yes,"
	wchrome += "menubar=no,height=400,width=580,top=150,left=250";
	setTimeout("window.open('" + turl +  "', 'popupWindow', '" + wchrome + "')", 1);
}

function GetMultiNames_p(returnField, specialParameters) {
	frm = window.document.forms[0];
	var url = "/utils/" ;
    turl = "/utils/contact-multi-remote.jsp?open&returnfield=" + returnField + specialParameters;
    var wchrome = "toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,resize=yes,"
    wchrome += "menubar=no,height=500,width=1000,top=20,left=50";
    setTimeout("window.open('" + turl +  "', 'popupWindow', '" + wchrome + "')", 1);
	
	/*
		var turl =  url + "contact-multi-remote.jsp?returnfield=" + returnField + specialParameters + "&pageNum=1&search=";
		var wchrome = "toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,resize=yes,"
		wchrome += "menubar=no,height=400,width=580,top=150,left=250";
		setTimeout("window.open('" + turl +  "', 'popupWindow', '" + wchrome + "')", 1);
	*/		
}


function limitText(limitField, limitCount, limitNum) {
 
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
 
function Submitidea()
{
var btn = document.getElementById( "btnSubmitIdeaGenerator");
 
var cont = confirm( "You are about to submit the Idea. Do you want to continue?");
		if ( !cont) return;
if (QuerySave(document.forms[0])) { btn.click() };
 
}
 
function saveidea()
{
var btn = document.getElementById( "btnSaveIdeaGenerator");
 
				
btn.click();
 
}
function cancelidea()
{
window.close()
}
 
function showTimeBar()
{
 width = document.body.clientWidth;
 height = document.body.clientHeight;
 Hoffset = img.offsetHeight;
 Woffset = img.offsetWidth;
 img.style.left = (width-Woffset)/2;
 img.style.top = (height-Hoffset)/2;
 img.style.visibility = "visible";
}
 
function Submitfeedback()
{
var btn = document.getElementById( "btnSubmitfeedbackGenerator");
if (QuerySave(document.forms[0]) && validatecustomfields(document.forms[0].chkBenefits) && validateFinanBenefit(document.getElementsByName("Finance"))) { 
var cont = confirm( "You are about to submit the feedback. Do you want to continue?");
		if ( !cont) return;
btn.click(); 
}
 
}
 
 
function IsNumber(val) {
oneDecimal = false;
inputVal = val; 
  inputStr = inputVal.toString();
 for (var i = 0; i < inputStr.length; i++) { 
     var oneChar = inputStr.charAt(i);
    if (i == 0 && oneChar == "-") {
    if (inputStr.length == 1) {
       return false;
    }else{
      continue
    }
    }
   if( inputStr.length != 1 && oneChar == "." && !oneDecimal) { 
       oneDecimal = true;
       continue;
  }
   if( oneChar < "0" || oneChar > "9") { 
       return false;
  }
}
return true;
}
 
function validatecustomfields(radVal){
 
 var radChk=radVal;
 if(radChk[1].checked){
   if (document.forms[0].taQuality.value==''){
   alert("Please enter appropriate value for Quality results");
   return false;
    } 
   //select quality option
   
 	if (document.forms[0].cmbQualityOptions.selectedIndex == 0) {
                     sFieldValue = "";
       } else {
                     sFieldValue = String(document.forms[0].cmbQualityOptions.selectedIndex);
       }
       
       if (sFieldValue=="") {
      alert("Please enter appropriate value for Quality option")
	 }
	 else{
return true;
            }      
  //endselect quality option
 } else if(radChk[2].checked){
   if (document.forms[0].taDays.value==''){
   alert("Please enter appropriate value for Order Lead Time");
   } 
  else{
	return true;
            }
 } 
else return true;
 
}
 
 
function getFieldValue ( theField, vType ) { 
         //this function will return the field value (or value list) based on the element type 
         
         theValue = ""; 
         sep = ""; 
         hits = 0; 
         //text is the user-entered value as a string
         if ( vType == "Text" ) return ( theField.value ); 
 
         //textarea is the user-entered value as a string array of one element
         if ( vType == "Textarea" ) return ( theField[0].value ); 
         
           //checkboxes & radio buttons are not so simple
		if ( vType == "Checkbox" || vType == "Radio" ) { 
		
		    	if ((theField.value != null) && (theField.checked ))
		    	
 				 theValue = theField.value
 			
        		else for ( i = 0; i < theField.length; i++ ) { 
        		
                 	if ( theField[i].checked ) { 
                 	
                    	  hits++; 
                      	if ( hits > 1 ) {
                         	sep = "; ";
                    	  } 
                      theValue += sep + theField[i].value; 
                } 
          }
          return ( theValue );
      } 
       
       
     //select is an array of selection pointers to an array of strings representing the choices
     if ( vType == "Select" ) { 
          for ( i = 0; i < theField.options.length; i++ ) {
                if ( theField.options[i].selected ){
				if( theField.options[i].value !=""){
					theValue += theField.options[i].value;
				}else{
					theValue += theField.options[i].text;
				}	
			}	
          } 
          return ( theValue );
     }
}
 
function hideApprovers(radVal){
 
 var radChk=document.getElementsByName(radVal.name);
 if(radChk[1].checked){
   document.getElementById('chkquality').style.visibility='visible';
	document.getElementById('chkdays').style.visibility='hidden';
         //document.getElementById('chkprodsav').style.visibility='hidden';
   //document.getElementById('chkmatsav').style.visibility='hidden';
      } else if(radChk[2].checked){
   document.getElementById('chkquality').style.visibility='hidden';
	document.getElementById('chkdays').style.visibility='visible';
         //document.getElementById('chkprodsav').style.visibility='hidden';
   //document.getElementById('chkmatsav').style.visibility='hidden';
 } 
else {
 document.getElementById('chkquality').style.visibility='hidden';
	document.getElementById('chkdays').style.visibility='hidden';
         //document.getElementById('chkprodsav').style.visibility='hidden';
 //  document.getElementById('chkmatsav').style.visibility='hidden';
  }
}
function cancelsavvy()
{
/*
frm=document.forms[0];
dbName=document.forms[0].dbName.value
HTTP_Referer=document.forms[0].HTTP_Referer.value
if (HTTP_Referer=="") {
document.location.href="/" +dbName + "/vwAllSolutionsdocs?OpenView&Start=1&Count=10"
}
else{
document.location.href=HTTP_Referer
}
//var tmpurl="/" +dbName + "/vwAllSolutionsdocs?OpenView&Start=1&Count=10"
 */

	document.location.href="/home.jsp";
}
 
 
function hideFinanApprovers(CurVal){
 var radChk=document.getElementsByName(CurVal.name);
  
 if(radChk[0].checked==true && radChk[1].checked==true && radChk[2].checked==false)
{
	document.getElementById('chkhardsaves').style.visibility='visible';
	document.getElementById('chkcostavoid').style.visibility='visible';
	document.getElementById('chkopporcost').style.visibility='hidden';
	document.forms[0].OpporCost.value="";
}
 
else if(radChk[0].checked==true && radChk[1].checked==false && radChk[2].checked==true)
{
	document.getElementById('chkhardsaves').style.visibility='visible';
	document.getElementById('chkcostavoid').style.visibility='hidden';
     document.getElementById('chkopporcost').style.visibility='visible';
     document.forms[0].CostAvoid.value="";
}
 
else if(radChk[0].checked==true && radChk[1].checked==true && radChk[2].checked==true)
{
	document.getElementById('chkhardsaves').style.visibility='visible';
	document.getElementById('chkcostavoid').style.visibility='visible';
     document.getElementById('chkopporcost').style.visibility='visible';
}
 
else if(radChk[0].checked==true && radChk[1].checked==false && radChk[2].checked==false)
{
	document.getElementById('chkhardsaves').style.visibility='visible';
	document.getElementById('chkcostavoid').style.visibility='hidden';
     document.getElementById('chkopporcost').style.visibility='hidden';
     document.forms[0].CostAvoid.value="";
     document.forms[0].OpporCost.value="";
}
 
else if(radChk[0].checked==false && radChk[1].checked==true && radChk[2].checked==false)
{
	document.getElementById('chkhardsaves').style.visibility='hidden';
	document.getElementById('chkcostavoid').style.visibility='visible';
     document.getElementById('chkopporcost').style.visibility='hidden';
     document.forms[0].HardSavings.value="";
     document.forms[0].OpporCost.value="";
}
 
else if(radChk[0].checked==false && radChk[1].checked==false && radChk[2].checked==true)
{
	document.getElementById('chkhardsaves').style.visibility='hidden';
	document.getElementById('chkcostavoid').style.visibility='hidden';
     document.getElementById('chkopporcost').style.visibility='visible';
     document.forms[0].HardSavings.value="";
     document.forms[0].CostAvoid.value="";     
}
 
else if(radChk[0].checked==false && radChk[1].checked==true && radChk[2].checked==true)
{
	document.getElementById('chkhardsaves').style.visibility='hidden';
	document.getElementById('chkcostavoid').style.visibility='visible';
     document.getElementById('chkopporcost').style.visibility='visible';
     document.forms[0].HardSavings.value="";
}
 
else if(radChk[0].checked==false && radChk[1].checked==false && radChk[2].checked==false)
{
	document.getElementById('chkhardsaves').style.visibility='hidden';
	document.getElementById('chkcostavoid').style.visibility='hidden';
     document.getElementById('chkopporcost').style.visibility='hidden';
     document.forms[0].HardSavings.value="";
     document.forms[0].CostAvoid.value="";     
     document.forms[0].OpporCost.value="";     
}
 
}
 
 
function validateFinanBenefit(radVal)
 {
 var radChk=radVal;
 
if(radChk[0].checked==false && radChk[1].checked==false && radChk[2].checked==false)
{
alert("Please select at least one of the Financial Benefit categories");
return false;
}
 
if(radChk[0].checked==true && radChk[1].checked==true && radChk[2].checked==false)
{
	if (document.forms[0].HardSavings.value!='' && document.forms[0].CostAvoid.value!='')
	{
		if (document.forms[0].HardSavings.value=="0" || document.forms[0].CostAvoid.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
	
}
 
else if(radChk[0].checked==true && radChk[1].checked==false && radChk[2].checked==true)
{
	if (document.forms[0].HardSavings.value!='' && document.forms[0].OpporCost.value!='')
	{
	if (document.forms[0].HardSavings.value=="0" || document.forms[0].OpporCost.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
 
else if(radChk[0].checked==true && radChk[1].checked==true && radChk[2].checked==true)
{
	if (document.forms[0].HardSavings.value!='' && document.forms[0].CostAvoid.value!='' && document.forms[0].OpporCost.value!='')
	{
	if (document.forms[0].HardSavings.value=="0" || document.forms[0].CostAvoid.value=="0" || document.forms[0].OpporCost.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
 
else if(radChk[0].checked==true && radChk[1].checked==false && radChk[2].checked==false)
{
	if (document.forms[0].HardSavings.value!='')
	{
	if (document.forms[0].HardSavings.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
 
else if(radChk[0].checked==false && radChk[1].checked==true && radChk[2].checked==false)
{
	if (document.forms[0].CostAvoid.value!='')
	{
	if (document.forms[0].CostAvoid.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
 
else if(radChk[0].checked==false && radChk[1].checked==false && radChk[2].checked==true)
{
	if (document.forms[0].OpporCost.value!='')
	{
	if (document.forms[0].OpporCost.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
 
else if(radChk[0].checked==false && radChk[1].checked==true && radChk[2].checked==true)
{
	if (document.forms[0].CostAvoid.value!='' && document.forms[0].OpporCost.value!='')
	{
	if (document.forms[0].CostAvoid.value=="0" || document.forms[0].OpporCost.value=="0")
		{
			alert("Please enter a value > 0 for the Financial Benefit category");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
	alert("Please enter a value for the selected Financial Benefit category (Hard Savings, Cost Avoidance, Opportunity Costs)");
	return false;
	}
}
else if(radChk[0].checked==false && radChk[1].checked==false && radChk[2].checked==false)
{
	return true;
}
 
} // End of Function
 
// -->
</script>
 
<script language="JavaScript" type="text/javascript"> 
<!-- 
document._domino_target = "_self";
function _doClick(v, o, t, h) {
  var form = document._frmfeedback;
  if (form.onsubmit) {
     var retVal = form.onsubmit();
     if (typeof retVal == "boolean" && retVal == false)
       return false;
  }
  var target = document._domino_target;
  if (o.href != null) {
    if (o.target != null)
       target = o.target;
  } else {
    if (t != null)
      target = t;
  }
  form.target = target;
  form.__Click.value = v;
  if (h != null)
    form.action += h;
  form.submit();
  return false;
}
// -->
</script>
 
<script language="JavaScript" type="text/javascript"> 
<!-- 
function clear1()
{
document.forms[0].SearchQuery1.value=""
 
}
 
function copydata()
{
 
document.forms[0].SearchQuery.value=document.forms[0].SearchQuery1.value
}
 
// -->
</script>
 
<script language="JavaScript" type="text/javascript"> 
<!-- 
function soonLaunch()
{
alert("This exciting new tool is soon to come to Operations Central!")
}
 
function DoNothing()
{
 
}
 
// -->
</script>
</head>
<body text="#000000" bgcolor="#FFFFFF" onload="if(document.forms[0].FieldStatus.value != &quot;feedbacksubmitted&quot;){
 
//tmp = getFieldValue ( document.forms[0].chkBenefits, 'Radio' ) ;
var j=0;
for (var i=0; i &lt; document.forms[0].chkBenefits.length; i++)
   {
   if (document.forms[0].chkBenefits[i].checked)
      {
      j++;
      var tmp = document.forms[0].chkBenefits[i].value;
      }
   }
   if (j==0) tmp=&quot;&quot;;
   
   
 
if(tmp == &quot;1&quot; || tmp == &quot;6&quot; || tmp == &quot;7&quot; || tmp==&quot;&quot;) {	
				
						document.getElementById('chkquality').style.visibility='hidden';						
				
						document.getElementById('chkdays').style.visibility='hidden';							
				
						//document.getElementById('chkprodsav').style.visibility='hidden';
						
						//document.getElementById('chkmatsav').style.visibility='hidden';
								
	} else if(tmp == &quot;2&quot;){ 			
				
						document.getElementById('chkquality').style.visibility='visible';
						
						document.getElementById('chkdays').style.visibility='hidden';
						
						//document.getElementById('chkprodsav').style.visibility='hidden';
							
						//document.getElementById('chkmatsav').style.visibility='hidden';
						
						         
		} else if(tmp == &quot;3&quot;){ 
			
						document.getElementById('chkquality').style.visibility='hidden';
						
						document.getElementById('chkdays').style.visibility='visible';
						
						//document.getElementById('chkprodsav').style.visibility='hidden';
						
						//document.getElementById('chkmatsav').style.visibility='hidden';
						
	     }
else if(tmp = &quot;4&quot;){ 
			
						document.getElementById('chkquality').style.visibility='hidden';
							
						document.getElementById('chkdays').style.visibility='hidden';
						
						//document.getElementById('chkprodsav').style.visibility='visible';
						
						//document.getElementById('chkmatsav').style.visibility='hidden';
						       
		}	
else if(tmp = &quot;5&quot;){ 
				
						document.getElementById('chkquality').style.visibility='hidden';
						
						document.getElementById('chkdays').style.visibility='hidden';
						
						//document.getElementById('chkprodsav').style.visibility='hidden';
							
						//document.getElementById('chkmatsav').style.visibility='visible';
						      
		}		
		}">
 
<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>

<%
   BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
%>

<form method="post" action="<%= blobstoreService.createUploadUrl("/newadoptsolution")%>" enctype="multipart/form-data" name="_frmfeedback">
<input type="hidden" name="__Click" value="0"><div style="display:none">
<input name="photodocid" value=""></div>
<div style="display:none">global/collaboration/SavvySol.nsf</div>
<input name="imgPath" type="hidden" value="global/collaboration/SavvySol.nsf">
<SCRIPT LANGUAGE="JavaScript1.2" SRC="/js/scriptsevents.js"  TYPE='text/javascript'></SCRIPT>
<script type="text/javascript"> 
if (_show_editor){
var dbName="global/collaboration/SavvySol.nsf"
	tinyMCE.init({
mode :"textareas",
				theme : "advanced",
				width : "500",
						editor_deselector : "myNonBasicEditor",
	plugins: "inlinepopups,advimage,table,emotions",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		theme_advanced_resizing : true,
theme_advanced_buttons1 :"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,cleanup,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,|,sub,sup",
theme_advanced_fonts : "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace",
		content_css : "styles/editor.css",
theme_advanced_path : "false",
relative_urls : false,
document_base_url : "http:///global/collaboration/SavvySol.nsf/",
			external_image_list_url : "/global/collaboration/SavvySol.nsf/pagRTEImages.js",
		content_css : "styles/editor.css"
	})
}
</script><SCRIPT LANGUAGE="JavaScript1.2" SRC="/js/FusionCharts.js"  TYPE='text/javascript'></SCRIPT>
